// program:	master.do
// project:	constituency size
// task:	run replication code for "Constituency Size and Evaluations of Government"
// author:	daniel bowen
// date:	7/30/2021

// set working directory. change to location of project
cd ~\OneDrive\constituency-size\replication\

// descriptive presentation of constituency size and chamber size over time
do cs-history.do

// import and clean Pew survey data - requires user to download survey data
//		prior to running code. See README.txt for source urls.
clear
save cs-recode.dta, emptyok replace

#delimit ;
do pew97layout.do; 		append using cs-recode.dta; save cs-recode.dta, replace;
do pew2001midnov.do; 	append using cs-recode.dta; save cs-recode.dta, replace;
do pew2002dec.do; 		append using cs-recode.dta; save cs-recode.dta, replace;
do pew2005dec.do; 		append using cs-recode.dta; save cs-recode.dta, replace;
do pew2008april.do; 	append using cs-recode.dta; save cs-recode.dta, replace;
do pew2009july.do; 		append using cs-recode.dta; save cs-recode.dta, replace;
do pew2010feb.do; 		append using cs-recode.dta; save cs-recode.dta, replace;
do pew2011feb.do; 		append using cs-recode.dta; save cs-recode.dta, replace;
do pew2012april.do; 	append using cs-recode.dta; save cs-recode.dta, replace;
#delimit cr

// complete recodes and merge survey data with state-level variables
do cs-recode.do

// run core models for paper and appendix; generate tables (2, 3, 4 and several tables
//		in the appendix) and Fig. 5
do cs-estimate.do

// create Figure OA2, graph of marginal effect of alt constituency size measures
do cs-alt-me-graph.do

// MRP Analysis (Table 1; Fig 4)
do cs-mrp.do

// Load entropy and Theil's H data, create Fig 7.
do cs-acs-graph.do

// Analysis of causal mechanisms
do cs-mech.do
do cs-alt-mech-personal.do

// District-level Analyses
do cs-zip.do



